# Contributor: Rabindra Dhakal <contact@qaidvoid.dev>
# Maintainer: Rabindra Dhakal <contact@qaidvoid.dev>
pkgname=xdg-desktop-portal-hyprland
pkgver=1.3.1
pkgrel=2
pkgdesc="xdg-desktop-portal backend for hyprland"
url="https://github.com/hyprwm/xdg-desktop-portal-hyprland"
arch="all !armhf !armv7 !x86" # 32bit builds broken
license="BSD-3-Clause"
options="!check" # No tests
depends="
	hyprlang
	xdg-desktop-portal
	"
makedepends="
	basu-dev
	cmake
	hyprland-protocols
	pipewire-dev
	qt6-qtwayland-dev
	sdbus-cpp-dev
	wayland-dev
	"
subpackages="$pkgname-doc"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/hyprwm/xdg-desktop-portal-hyprland/archive/v$pkgver.tar.gz
	use-system-installed-sdbus-c++.patch
	"

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_LIBEXECDIR=/usr/libexec \
		-DCMAKE_INSTALL_PREFIX=/usr
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build

	rm -rf "$pkgdir"/usr/lib/systemd
	install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

sha512sums="
8d0f9b97fca4566efe717de6d739d10ec51ce5aa33459940f759fc90543fcca3b094d3e570446c5f82c9146249ce39c00fa215b0b83573a466a9907aec9366f3  xdg-desktop-portal-hyprland-1.3.1.tar.gz
dc93557c1faa0e903ad133cd96484b9b1bb7d6fceb09b5a8c71e5053deb6db1e34fd31a11f7b8a41d2468abe310414d831ca43cdf15b947a5dec562297e870a2  use-system-installed-sdbus-c++.patch
"
